home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / pc / macf / mger.dir / 00012_Quicktime.ls < prev    next >
Encoding:
Text File  |  1995-10-10  |  7.6 KB  |  275 lines

  1. on playQT name, loc, fullscreen
  2.   global movieID, QTEnd
  3.   if length(movieID) = 0 then
  4.     set movieID to QTMovie("OpenMovie", "Direct", the pathName & string(name), string(loc), "closedOnFinish", "fastIdle")
  5.   end if
  6.   if movieID contains "error" then
  7.     put movieID
  8.     beep()
  9.   end if
  10.   set QTEnd to QTMovie("Direct", movieID, "Get", "duration")
  11.   QTMovie("Direct", movieID, "set", "currTime", 0)
  12.   if fullscreen = 1 then
  13.     QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 640, 480")
  14.   end if
  15.   repeat while value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd)
  16.     QTMovie("Direct", movieID, "Idle")
  17.   end repeat
  18.   stopQT()
  19. end
  20.  
  21. on playQTP name, loc, fullscreen
  22.   global movieID, QTEnd, fullscreenG, LowBnd, lastFrame
  23.   if length(movieID) = 0 then
  24.     set movieID to QTMovie("OpenMovie", "Direct", string(name), string(loc), "closedOnFinish", "fastIdle")
  25.   end if
  26.   if movieID contains "error" then
  27.     put "inside error"
  28.     put movieID
  29.     beep()
  30.   end if
  31.   set QTEnd to QTMovie("Direct", movieID, "Get", "duration")
  32.   QTMovie("Direct", movieID, "set", "currTime", 0)
  33.   if fullscreen = 1 then
  34.     QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 320, 240")
  35.   else
  36.     QTMovie("Direct", movieID, "Set", "MovieRect", "160, 140, 480, 380")
  37.   end if
  38.   set LowBnd to -1
  39.   put "after LowBnd"
  40.   QTMovie("Direct", movieID, "play")
  41.   put "after play"
  42.   put "movieID", movieID
  43.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd)) and (value(QTMovie("Direct", movieID, "Get", "currTime")) > LowBnd)
  44.     put "Above play Prvw"
  45.     play frame "F3"
  46.   end repeat
  47.   stopQT()
  48.   put "after stopQT"
  49.   go(lastFrame)
  50. end
  51.  
  52. on playQTF name, loc, fullscreen
  53.   global movieID, QTEnd, fullscreenG, LowBnd, Current, lastFrame, CurrentAudio, Clips, gSpeed
  54.   set movieID to QTMovie("OpenMovie", "Direct", string(name), string(loc), "closedOnFinish", "fastIdle")
  55.   if movieID contains "error" then
  56.     put "inside error"
  57.     put movieID
  58.     beep()
  59.   end if
  60.   set QTEnd to QTMovie("Direct", movieID, "Get", "duration")
  61.   QTMovie("Direct", movieID, "set", "currTime", 0)
  62.   set CurrentAudio to string(CurrentAudio)
  63.   QTMovie("Direct", movieID, "Set", "audioLevel", CurrentAudio)
  64.   if fullscreen = 1 then
  65.     QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 640, 480")
  66.   else
  67.     QTMovie("Direct", movieID, "Set", "MovieRect", "160, 140, 480, 380")
  68.   end if
  69.   set LowBnd to -1
  70.   QTMovie("Direct", movieID, "play")
  71.   if gSpeed = 2 then
  72.     Forward()
  73.   end if
  74.   repeat while (value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd)) and (value(QTMovie("Direct", movieID, "Get", "currTime")) > LowBnd)
  75.     if Current = 1 then
  76.       play frame "F2"
  77.       next repeat
  78.     end if
  79.     if Current = 0 then
  80.       play frame "F3"
  81.       next repeat
  82.     end if
  83.     play frame "F4"
  84.   end repeat
  85.   if Current = 0 then
  86.     if fullscreenG = 1 then
  87.       ChangeScreenSize(Clips, "160,140", 0)
  88.     end if
  89.   end if
  90.   updateStage()
  91.   stopQT()
  92.   if Current = 1 then
  93.     go(19)
  94.   else
  95.     if Current = 0 then
  96.       repeat with x = 13 to 17
  97.         puppetSprite(x, 1)
  98.         set the visible of sprite x to 1
  99.         puppetSprite(x, 0)
  100.       end repeat
  101.       puppetSprite(19, 1)
  102.       set the visible of sprite 19 to 0
  103.       go(lastFrame - 1)
  104.       repeat with x = 3 to 7
  105.         puppetSprite(x, 1)
  106.         set the visible of sprite x to 1
  107.         puppetSprite(x, 0)
  108.       end repeat
  109.       set MovieSeq to 0
  110.       setbar()
  111.       updateStage()
  112.     else
  113.       if fullscreenG = 1 then
  114.         ChangeScreenSize(Clips, "160,140", 0)
  115.       end if
  116.       go("Intro")
  117.     end if
  118.   end if
  119. end
  120.  
  121. on stopQT
  122.   global movieID, LastButton
  123.   QTMovie("Direct", movieID, "Dispose")
  124.   set movieID to EMPTY
  125.   set LastButton to 0
  126. end
  127.  
  128. on stopQTP
  129.   global movieID, LastButton
  130.   QTMovie("Direct", movieID, "Dispose")
  131.   set movieID to EMPTY
  132.   set LastButton to 0
  133. end
  134.  
  135. on IdleQT
  136.   global movieID, QTEnd
  137.   QTMovie("Direct", movieID, "Idle")
  138.   if value(QTMovie("Direct", movieID, "Get", "currTime")) >= value(QTEnd) then
  139.     stopQT()
  140.   end if
  141. end
  142.  
  143. on pauseQT
  144.   global movieID, LastButton
  145.   put "inside pauseQT"
  146.   QTMovie("Direct", movieID, "pause")
  147.   set LastButton to 1
  148. end
  149.  
  150. on unpauseQT
  151.   global movieID
  152.   put "unpauseQT"
  153.   QTMovie("Direct", movieID, "play")
  154. end
  155.  
  156. on restartQT name, loc, fullscreen
  157.   global movieID, QTEnd
  158.   put "inside restart QT"
  159.   if length(movieID) = 0 then
  160.     set movieID to QTMovie("OpenMovie", "Direct", the pathName & string(name), string(loc), "closedOnFinish", "fastIdle")
  161.   end if
  162.   if movieID contains "error" then
  163.     put movieID
  164.     beep()
  165.   end if
  166.   set QTEnd to QTMovie("Direct", movieID, "Get", "duration")
  167.   if fullscreen = 1 then
  168.     QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 640, 480")
  169.   end if
  170.   repeat while value(QTMovie("Direct", movieID, "Get", "currTime")) < value(QTEnd)
  171.     QTMovie("Direct", movieID, "Idle")
  172.   end repeat
  173.   stopQT()
  174. end
  175.  
  176. on Rewind
  177.   global movieID, gRewind, LowBnd
  178.   if gRewind = 0 then
  179.     QTMovie("Direct", movieID, "reverse")
  180.     set gRewind to 1
  181.     set LowBnd to 0
  182.   end if
  183. end
  184.  
  185. on Forward
  186.   global movieID, gRewind, gSpeed, LastButton
  187.   put "inside Forward"
  188.   if gRewind = 1 then
  189.     QTMovie("Direct", movieID, "reverse")
  190.     set gRewind to 0
  191.   end if
  192.   set speed to 2.0
  193.   set speed to string(speed)
  194.   QTMovie("Direct", movieID, "Set", "rate", speed)
  195.   set gSpeed to 2
  196.   set LastButton to 1
  197. end
  198.  
  199. on ChangeScreenSize name, loc, type
  200.   global fullscreenG, movieID, QTEnd, gRewind, gSpeed, CurrentAudio
  201.   if fullscreenG = 0 then
  202.     if type = 1 then
  203.       puppetSprite(48, 1)
  204.       set the visible of sprite 48 to 1
  205.       set the moveableSprite of sprite 48 to 1
  206.       unLoadCast()
  207.       QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 640, 480")
  208.       updateStage()
  209.     end if
  210.     QTMovie("Direct", movieID, "Set", "MovieRect", "0, 0, 640, 480")
  211.     updateStage()
  212.     set fullscreenG to 1
  213.   else
  214.     set gRewind to 0
  215.     if type = 1 then
  216.       puppetSprite(48, 1)
  217.       set the moveableSprite of sprite 48 to 1
  218.       set the locV of sprite 48 to the locV of sprite 48 + 1
  219.       set the visible of sprite 48 to 0
  220.     end if
  221.     set CTime to QTMovie("Direct", movieID, "Get", "currTime")
  222.     QTMovie("Direct", movieID, "Dispose")
  223.     unLoadCast()
  224.     set movieID to QTMovie("OpenMovie", "Direct", string(name), string(loc), "closedOnFinish", "fastIdle")
  225.     if movieID contains "error" then
  226.       put movieID
  227.       beep()
  228.     end if
  229.     set QTEnd to QTMovie("Direct", movieID, "Get", "duration")
  230.     QTMovie("Direct", movieID, "set", "currTime", CTime)
  231.     set CurrentAudio to string(CurrentAudio)
  232.     QTMovie("Direct", movieID, "Set", "audioLevel", CurrentAudio)
  233.     QTMovie("Direct", movieID, "Set", "MovieRect", "160, 140, 480, 380")
  234.     updateStage()
  235.     if gSpeed = 2 then
  236.       set speed to 2.0
  237.       set speed to string(speed)
  238.       QTMovie("Direct", movieID, "Set", "rate", speed)
  239.     end if
  240.     set fullscreenG to 0
  241.     updateStage()
  242.   end if
  243. end
  244.  
  245. on IncreaseVol
  246.   global movieID, CurrentAudio
  247.   put "CurrentAudio", CurrentAudio
  248.   set CurrentAudio to QTMovie("Direct", movieID, "Get", "audioLevel")
  249.   if CurrentAudio < 255 then
  250.     set CurrentAudio to CurrentAudio + 30
  251.   end if
  252.   set CurrentAudio to integer(CurrentAudio)
  253.   set CurrentAudio to string(CurrentAudio)
  254.   pauseQT()
  255.   QTMovie("Direct", movieID, "Set", "audioLevel", CurrentAudio)
  256.   unpauseQT()
  257. end
  258.  
  259. on DecreaseVol
  260.   global movieID, CurrentAudio
  261.   set CurrentAudio to QTMovie("Direct", movieID, "Get", "audioLevel")
  262.   put "decreaseVol"
  263.   put "CurrentAudio", CurrentAudio
  264.   if CurrentAudio > 50 then
  265.     set CurrentAudio to CurrentAudio - 50
  266.   else
  267.     set CurrentAudio to 0
  268.   end if
  269.   set CurrentAudio to integer(CurrentAudio)
  270.   set CurrentAudio to string(CurrentAudio)
  271.   pauseQT()
  272.   QTMovie("Direct", movieID, "Set", "audioLevel", CurrentAudio)
  273.   unpauseQT()
  274. end
  275.